package com.laixu.estore.dao;

import com.laixu.estore.bean.pojo.Book;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @Auther: vanse(lc)
 * @Date: 2025/3/10-03-10-16:26
 * @Description：com.briup.estore.dao
 */
//@Mapper // 映射器|实例放入容器（代理类）
// mybatisX-> mybatis-plus | mybatis
public interface BookDao {
    // 查询书籍 jdbc- book.setName(rs.get("name"))
    // @Select @Insert @Update @Delete
//    @Select("select id, name, cover, description, author, publisher, price, store_num, status, category_id from es_book")
    List<Book> findAll();

    //    @Insert("insert into es_book(name,author,publisher) " +
//            "values (#{name},#{author},#{publisher})")
    void insert(Book book);

    List<Book> showBooks();

    Book getBookById(Integer id);

    void updateStore(@Param("bookId") Integer bookId,
                     @Param("num") Integer num);
}